Skip to content

Support stylus contracts publish and deploy #6495

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 30 commits into from
Mar 28, 2025

Conversation

kumaryash90
Copy link
Member

@kumaryash90 kumaryash90 commented Mar 18, 2025


PR-Codex overview

This PR introduces support for Stylus contracts in the CLI and SDK of the thirdweb package, enhancing its capabilities for deploying and managing contracts written in the Stylus programming language.

Detailed summary

  • Added support for Stylus contracts in the CLI and SDK.
  • Updated IArbWasm.json to include activateProgram function.
  • Modified deploy-metadata.ts to handle Stylus compiler.
  • Introduced activateStylusContract function for contract activation.
  • Updated CLI commands to include publish-stylus, deploy-stylus, and create-stylus.
  • Implemented createStylusProject for project setup.
  • Enhanced deployment functions to support extraDataWithUri for Stylus.
  • Added metadata handling for Stylus contracts in deployment processes.
  • Updated package dependencies to support new functionalities.

✨ Ask PR-Codex anything about this PR by commenting with /codex {your question}

@kumaryash90 kumaryash90 requested review from a team as code owners March 18, 2025 21:21
Copy link

changeset-bot bot commented Mar 18, 2025

🦋 Changeset detected

Latest commit: d90dda7

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
thirdweb Patch
@thirdweb-dev/wagmi-adapter Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link

vercel bot commented Mar 18, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
docs-v2 ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 28, 2025 3:21am
4 Skipped Deployments
Name Status Preview Comments Updated (UTC)
login ⬜️ Skipped (Inspect) Mar 28, 2025 3:21am
thirdweb_playground ⬜️ Skipped (Inspect) Mar 28, 2025 3:21am
thirdweb-www ⬜️ Skipped (Inspect) Mar 28, 2025 3:21am
wallet-ui ⬜️ Skipped (Inspect) Mar 28, 2025 3:21am

@kumaryash90 kumaryash90 marked this pull request as draft March 18, 2025 21:21
Copy link
Contributor

graphite-app bot commented Mar 18, 2025

How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • merge-queue - adds this PR to the back of the merge queue
  • hotfix - for urgent hot fixes, skip the queue and merge this PR next

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

@github-actions github-actions bot added packages SDK Involves changes to the thirdweb SDK labels Mar 18, 2025
@vercel vercel bot temporarily deployed to Preview – login March 18, 2025 21:22 Inactive
@vercel vercel bot temporarily deployed to Preview – thirdweb-www March 18, 2025 21:22 Inactive
@vercel vercel bot temporarily deployed to Preview – thirdweb_playground March 18, 2025 21:22 Inactive
@vercel vercel bot temporarily deployed to Preview – wallet-ui March 18, 2025 21:22 Inactive
Copy link

socket-security bot commented Mar 18, 2025

New dependencies detected. Learn more about Socket for GitHub ↗︎

Package New capabilities Transitives Size Publisher
npm/@types/[email protected] None +1 17.9 kB types
npm/[email protected] environment +8 86.7 kB sindresorhus
npm/[email protected] environment +17 288 kB sindresorhus
npm/[email protected] None 0 144 kB binarymuse

View full report↗︎

Copy link
Contributor

github-actions bot commented Mar 18, 2025

size-limit report 📦

Path Size Loading time (3g) Running time (snapdragon) Total time
thirdweb (esm) 47.56 KB (0%) 952 ms (0%) 136 ms (+135.56% 🔺) 1.1 s
thirdweb (cjs) 127.31 KB (0%) 2.6 s (0%) 205 ms (+23.94% 🔺) 2.8 s
thirdweb (minimal + tree-shaking) 5.6 KB (0%) 113 ms (0%) 80 ms (+1118.71% 🔺) 192 ms
thirdweb/chains (tree-shaking) 506 B (0%) 10 ms (0%) 29 ms (+1385.02% 🔺) 39 ms
thirdweb/react (minimal + tree-shaking) 19.34 KB (0%) 387 ms (0%) 86 ms (+469.29% 🔺) 473 ms

Copy link

codecov bot commented Mar 18, 2025

Codecov Report

Attention: Patch coverage is 30.92105% with 105 lines in your changes missing coverage. Please review.

Project coverage is 54.99%. Comparing base (06f0765) to head (d90dda7).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
.../extensions/stylus/write/activateStylusContract.ts 12.28% 50 Missing ⚠️
...hirdweb/src/contract/deployment/deploy-with-abi.ts 44.11% 19 Missing ⚠️
...hirdweb/src/contract/deployment/utils/bootstrap.ts 22.22% 14 Missing ⚠️
...eb/src/utils/any-evm/encode-extra-data-with-uri.ts 30.00% 7 Missing ⚠️
.../any-evm/compute-published-contract-deploy-info.ts 57.14% 6 Missing ⚠️
...eb/src/utils/any-evm/compute-deployment-address.ts 16.66% 5 Missing ⚠️
...rdweb/src/extensions/prebuilts/deploy-published.ts 63.63% 4 Missing ⚠️

❌ Your patch status has failed because the patch coverage (30.92%) is below the target coverage (80.00%). You can increase the patch coverage or adjust the target coverage.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6495      +/-   ##
==========================================
- Coverage   55.07%   54.99%   -0.09%     
==========================================
  Files         883      885       +2     
  Lines       55361    55492     +131     
  Branches     3791     3795       +4     
==========================================
+ Hits        30490    30517      +27     
- Misses      24776    24880     +104     
  Partials       95       95              
Flag Coverage Δ
packages 54.99% <30.92%> (-0.09%) ⬇️
Files with missing lines Coverage Δ
...eb/src/contract/deployment/deploy-deterministic.ts 100.00% <100.00%> (ø)
...es/thirdweb/src/contract/deployment/utils/infra.ts 100.00% <100.00%> (ø)
...ages/thirdweb/src/utils/any-evm/deploy-metadata.ts 83.33% <ø> (ø)
...rdweb/src/extensions/prebuilts/deploy-published.ts 85.98% <63.63%> (-0.82%) ⬇️
...eb/src/utils/any-evm/compute-deployment-address.ts 83.33% <16.66%> (-13.73%) ⬇️
.../any-evm/compute-published-contract-deploy-info.ts 93.47% <57.14%> (-6.53%) ⬇️
...eb/src/utils/any-evm/encode-extra-data-with-uri.ts 30.00% <30.00%> (ø)
...hirdweb/src/contract/deployment/utils/bootstrap.ts 90.15% <22.22%> (-6.99%) ⬇️
...hirdweb/src/contract/deployment/deploy-with-abi.ts 70.27% <44.11%> (-8.62%) ⬇️
.../extensions/stylus/write/activateStylusContract.ts 12.28% <12.28%> (ø)

... and 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Contributor

This PR has been inactive for 7 days. It is now marked as stale and will be closed in 2 days if no further activity occurs.

@github-actions github-actions bot added the Stale label Mar 26, 2025
const initcodeResult = spawnSync("cargo", ["stylus", "get-initcode"], {
encoding: "utf-8",
});
const initcode = extractBytecode(initcodeResult.stdout);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Check for error here

},
sources: {},
};
spinner.succeed("ABI cleaned and saved.");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Prob don't need this line

}): Promise<string> {
const { account, client, chain, compilerMetadata, contractParams, salt } =
options;

const { deployContract } = await import(
"../../contract/deployment/deploy-with-abi.js"
);
const isStylus = options.compilerMetadata.metadata.language === "rust";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How come you're not looking at compiler type here?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we have that in publish data, but not in compiler metadata (so, I add language as rust and check it later).

@vercel vercel bot temporarily deployed to Preview – login March 28, 2025 03:15 Inactive
@vercel vercel bot temporarily deployed to Preview – thirdweb_playground March 28, 2025 03:15 Inactive
@vercel vercel bot temporarily deployed to Preview – wallet-ui March 28, 2025 03:15 Inactive
@vercel vercel bot temporarily deployed to Preview – thirdweb-www March 28, 2025 03:15 Inactive
@joaquim-verges joaquim-verges merged commit b49c191 into main Mar 28, 2025
30 of 31 checks passed
@joaquim-verges joaquim-verges deleted the yash/stylus-publish-deploy branch March 28, 2025 18:34
@joaquim-verges joaquim-verges mentioned this pull request Mar 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
packages SDK Involves changes to the thirdweb SDK
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants